<template>
	<el-form  :model="contentform" label-width="80px">
		<el-form-item label="序号">
			<el-input v-model="contentform.nursingId"></el-input>
		</el-form-item>
		<el-form-item label="名称">
			<el-input v-model="contentform.nursingName"></el-input>
		</el-form-item>
		<el-form-item label="价格">
			<el-input v-model="contentform.nursingPrice"></el-input>
		</el-form-item>
		<el-form-item label="描述">
			<el-input v-model="contentform.nursingDescribe"></el-input>
		</el-form-item><el-form-item label="是否增值服务">
			<el-input v-model="contentform.service"></el-input>
		</el-form-item>
		<el-form-item label="状态">
			<el-input v-model="contentform.status"></el-input>
		</el-form-item>
		<el-button type="primary" @click="doEdit">提交</el-button>
		</el-form-item>
		
		</el-form>
</template>

<script>
	export default{
		name:'ContentEdit',
		props:{
			formData:{
				type:Object,
				default:()=>({})
			},
			editVisible:{
				type:Boolean,
			}
		},
		data(){
			return {
				contentform:{
				nursingId:'',
				nursingName:'',
				nursingPrice:'',
				nursingDescribe:'',
				service:'',
				status:''
				}
			}
		},
		mounted(){
			this.contentform=this.formData;
			
		},
		methods:{
			doEdit(){
				this.postRequest("/content/update",this.contentform).then(resp=>{
					if(resp){
						this.$emit("update:editVisible",false);
					}else{
						this.$message.error({message:'编辑失败'});
					}
				})
			}
		},
		watch:{
			formData:{
				deep:true,
				handler(newVal,oldVal){
					this.levelform=newVal
				}
			}
		}
	}
</script>

<style>
</style>
